/*
* @author dumeng
*/
'use strict'
import request from '@/utils/request'
/**
 * 异步企业部门树
 */
export function getComAndOrgTree(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/getDeptTree',
    method: 'post',
    data
  })
}

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/questionnaireSurvey/queryPage',
    method: 'post',
    data
  })
}

export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/questionnaireSurvey/get',
    method: 'post',
    data
  })
}

export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/questionnaireSurvey/insert',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/questionnaireSurvey/update',
    method: 'post',
    data
  })
}

export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/questionnaireSurvey/updateStatus',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/questionnaireSurvey/deleteById',
    method: 'post',
    data
  })
}
export function statistics(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/questionnaireSurvey/questionaryStatistics',
    method: 'post',
    data
  })
}

export function queryPage4answer(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/questionnaireSurvey/questionaryStatisticsDetil',
    method: 'post',
    data
  })
}

/**
 * 导出统计
 */
export function exportFile(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/questionnaireSurvey/topicResultExport',
    method: 'post',
    responseType: 'blob',
    data
  })
}

/**
 * 导出统计
 */
export function exportFileDetail(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/questionnaireSurvey/resultDetailExport',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 导出统计脱敏
 */
export function exportFileDetailMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/questionnaireSurvey/resultDetailExportMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 导出统计不脱敏
 */
export function exportFileDetailNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/questionnaireSurvey/resultDetailExportNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}